<?php
echo "<table id = 'list_catbyid' border ='1'>";
	$limit = count($danhba)/4;
	for($i=0;$i<$limit;$i++){
		echo "<tr>";
			echo "<td>";
				if (isset($danhba[$i]['id'])){
					echo $danhba[$i]['company_name'];
					echo $danhba[$i]['img1'];
					echo $danhba[$i]['address'];
					echo $danhba[$i]['phone'];
					echo $danhba[$i]['services_offered'];
				}
			echo "</td>";
			echo "<td>";
				$j1=$i+1;
				if (isset($danhba[$j1]['id'])){
					echo $danhba[$j1]['company_name'];
					echo $danhba[$j1]['img1'];
					echo $danhba[$j1]['address'];
					echo $danhba[$j1]['phone'];
					echo $danhba[$j1]['services_offered'];
				}
			echo "</td>";
			echo "<td>";
				$j2=$i+2;
				if (isset($danhba[$j2]['id'])){
					echo $danhba[$j2]['company_name'];
					echo $danhba[$j2]['img1'];
					echo $danhba[$j2]['address'];
					echo $danhba[$j2]['phone'];
					echo $danhba[$j2]['services_offered'];
				}
			echo "</td>";
			echo "<td>";
				$j3=$i+3;
				if (isset($danhba[$j3]['id'])){
					echo $danhba[$j3]['company_name'];
					echo $danhba[$j3]['img1'];
					echo $danhba[$j3]['address'];
					echo $danhba[$j3]['phone'];
					echo $danhba[$j3]['services_offered'];
				}
			echo "</td>";
		echo "</tr>";
	}
	echo "<tr>";
		echo"<td colspan='4'>";
			echo $this->pagination->create_links(); 
		echo "</td>";
	echo "</tr>";
echo "</table>";